DESTDIR = $(HOME)/.compiz/plugins

PLUGIN  = wobbly

CC      = gcc
LIBTOOL = libtool
INSTALL = install

CFLAGS  = -Wall `pkg-config --cflags compiz`
LDFLAGS = `pkg-config --libs compiz`

%.lo: %.c
	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<

%.la: $(PLUGIN).lo
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -rpath $(DESTDIR) -o $@ $<

all: lib$(PLUGIN).la

install: lib$(PLUGIN).la
	$(LIBTOOL) --mode=install $(INSTALL) lib$(PLUGIN).la \
	$(DESTDIR)/lib$(PLUGIN).la

clean:
	rm -rf *.lo *.o lib$(PLUGIN).* .libs


